/**
 * Created by yanwenchuang on 2016/10/22.
 */
'use strict';
angular.module("app").factory("NavigationService", ["$http", "$log","$q" ,function ($http, $log,$q) {
    function getNavigation() {
        var deferred = $q.defer();
        $http({
            method: 'GET',
            url: '/security/navigation',
        }).then(function (response) {
            deferred.resolve(response.data);
            return response.data;
        }, function (response) {
            $log.error(response);
            deferred.reject(response);
        });
        return deferred.promise;
    }

    return {
        nav:getNavigation
    }
}]);